import {lazy} from 'react'

const cart = lazy(()=>import("../page/cart"))
const cate = lazy(()=>import("../page/cate"))
const goodsDetail = lazy(()=>import("../page/goodsDetail"))
const goodsList = lazy(()=>import("../page/goodslist"))
const index = lazy(()=>import("../page/index"))
const login = lazy(()=>import("../page/login"))
const uncenter = lazy(()=>import("../page/uncenter"))
const register = lazy(()=>import("../page/register"))
const coupon = lazy(()=>import("../page/coupon"))
const page404 = lazy(()=>import("../page/page404"))


const rules = [
    {
        path: "/",
        redirect: "/index",
        exact: true,
        requeireLogin: false
    },
    {
        path: "/index",
        component: index,
        exact: false,
        requeireLogin: false
    },
    {
        path: "/cart",
        component: cart,
        exact: false,
        requeireLogin: true
    },
    {
        path: "/cate",
        component: cate,
        exact: false,
        requeireLogin: false
    },
    {
        path: "/goodsdetail",
        component: goodsDetail,
        exact: false,
        requeireLogin: false
    },
    {
        path: "/goodslist",
        component: goodsList,
        exact: false,
        requeireLogin: false
    },
    {
        path: "/login",
        component: login,
        exact: false,
        requeireLogin: false
    },
    {
        path: "/register",
        component: register,
        exact: false,
        requeireLogin: false
    },
    {
        path: "/uncenter",
        component: uncenter,
        exact: false,
        requeireLogin: true
    },
    {
        path: "/coupon",
        component: coupon,
        exact: false,
        requeireLogin: true
    },
    {
        path: "*",
        component: page404,
        exact: false,
        requeireLogin: false
    },
    

]

export default rules